package com.yoga.admin.api.web;

import com.yoga.common.appexception.AppException;
import com.yoga.common.appexception.YogaResult;
import com.yoga.common.enumcommon.SmsBusinessEnum;
import com.yoga.manager.app.CaptchaCodeManager;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by chenjin on 2020/3/12.
 */
@RestController
@RequestMapping("${basePath}")
public class AdminCaptchaCodeController {

    @Resource
    private CaptchaCodeManager captchaCodeManager;

    @PostMapping("/send/code")
    public YogaResult addToCache(String phoneNumber, SmsBusinessEnum captchaTypeEnum) throws AppException{
         return new YogaResult(captchaCodeManager.addToCache(phoneNumber,captchaTypeEnum));
    }


}
